export default {
	namespaced: true,
	state: {
		_id: '',
		username: '',
		password: '',
		avatar: '',
		sex: 0,
		gainObjs: null
	},
	mutations: {
		//初始化赋值
		USER_INIT(state,obj) {
			if(!obj) {
				state._id =localStorage.getItem('_id');
				state.username = localStorage.getItem('username');
				state.password = localStorage.getItem('password');
				state.avatar = localStorage.getItem('avatar');
				state.sex = localStorage.getItem('sex');
			}else {
				state._id = obj._id;
				state.username = obj.username;
				state.password = obj.password;
				state.avatar = obj.avatar;
				state.sex = obj.sex;
			}
		},
	},
	actions: {
		
	},
	getters: {
		msg: state => {
			// return "456456456"
			return {
				_id: state._id,
				username: state.username,
				password: state.password,
				avatar: state.avatar,
				sex: state.sex,
				gainObjs: state.gainObjs
			}
		}
	}
}